<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRecommendTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recommend', function (Blueprint $table) {
            $table->increments('id');
            $table->string('recommend_word',100)->notNull()->comment('推荐词');
            $table->string('search_word',100)->notNull()->comment('搜索词');
            $table->integer('weight')->notNull()->default(0)->comment('权重');
            $table->timestamp('start_time')->default(\DB::raw('CURRENT_TIMESTAMP'))->comment('开始时间');
            $table->timestamp('end_time')->default(\DB::raw('CURRENT_TIMESTAMP'))->comment('结束时间');
            $table->string('remark',100)->nullable()->comment('备注');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recommend');
    }
}
